home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / PCUn95 / Shell / frmPrinc.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-02-10  |  3.4 KB  |  116 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPrinc 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Ejecutando aplicaciones"
  5.    ClientHeight    =   3570
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4485
  9.    Icon            =   "frmPrinc.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3570
  14.    ScaleWidth      =   4485
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton cmdEjecutar 
  17.       Caption         =   "Ejecutar"
  18.       Height          =   495
  19.       Index           =   4
  20.       Left            =   360
  21.       TabIndex        =   5
  22.       Top             =   2760
  23.       Width           =   1215
  24.    End
  25.    Begin VB.TextBox txtArchivo 
  26.       Height          =   285
  27.       Left            =   360
  28.       TabIndex        =   0
  29.       Top             =   2280
  30.       Width           =   3735
  31.    End
  32.    Begin VB.CommandButton cmdEjecutar 
  33.       Caption         =   "Abrir el explorador"
  34.       Height          =   615
  35.       Index           =   3
  36.       Left            =   2280
  37.       TabIndex        =   4
  38.       Top             =   1080
  39.       Width           =   1815
  40.    End
  41.    Begin VB.CommandButton cmdEjecutar 
  42.       Caption         =   "Ver archivo de texto"
  43.       Height          =   615
  44.       Index           =   2
  45.       Left            =   360
  46.       TabIndex        =   3
  47.       Top             =   1080
  48.       Width           =   1815
  49.    End
  50.    Begin VB.CommandButton cmdEjecutar 
  51.       Caption         =   "El reproductor de CDs"
  52.       Height          =   615
  53.       Index           =   1
  54.       Left            =   2280
  55.       TabIndex        =   2
  56.       Top             =   360
  57.       Width           =   1815
  58.    End
  59.    Begin VB.CommandButton cmdEjecutar 
  60.       Caption         =   "Calculadora"
  61.       Height          =   615
  62.       Index           =   0
  63.       Left            =   360
  64.       TabIndex        =   1
  65.       Top             =   360
  66.       Width           =   1815
  67.    End
  68.    Begin VB.Label lblTitulo 
  69.       AutoSize        =   -1  'True
  70.       Caption         =   "Archivo a ejecutar (y par
  71. metros):"
  72.       Height          =   195
  73.       Left            =   360
  74.       TabIndex        =   6
  75.       Top             =   1920
  76.       Width           =   2370
  77.    End
  78. Attribute VB_Name = "frmPrinc"
  79. Attribute VB_GlobalNameSpace = False
  80. Attribute VB_Creatable = False
  81. Attribute VB_PredeclaredId = True
  82. Attribute VB_Exposed = False
  83. Option Explicit
  84. Private Sub cmdEjecutar_Click(Index As Integer)
  85.    Dim ret As Long
  86.    'Cuando haya un error, ir hasta "Errores"
  87.    On Error GoTo Errores
  88.    'Seg
  89. n el bot
  90. n que haya pulsado...
  91.    Select Case Index
  92.       Case 0
  93.          ret = Shell("calc", vbNormalFocus)
  94.       Case 1
  95.          ret = Shell("cdplayer", vbNormalFocus)
  96.       Case 2
  97.          ret = Shell("notepad c:\windows\readme.txt", vbMaximizedFocus)
  98.       Case 3
  99.          ret = Shell("explorer c:\windows", vbMaximizedFocus)
  100.       Case 4
  101.          ret = Shell(txtArchivo, vbNormalFocus)
  102.    End Select
  103.    'Deshabilitamos el manejo de errores...
  104.    On Error GoTo 0
  105.    Exit Sub
  106. Errores:
  107.    'Si el error fue que no exist
  108. a el archivo...
  109.    If Err = 53 Then
  110.       MsgBox "No se encontr
  111.  el archivo!"
  112.    End If
  113.    'Seguir con la sentencia siguiente
  114.    Resume Next
  115. End Sub
  116.